package chapter1;

/**
 * @Author juzipi
 * @Date 2021/5/10 16:51
 * @Info
 */
public class ClinitTest1 {

    static class Father{
        public static int A = 1;
        static {
            A = 2;
        }

    }
    static class Son extends Father{
        public static int B = A;

    }

    public static void main(String[] args) {
        //首先加载Father类再加载Son类，所以结果就是2
        System.out.println(Son.B);
        System.out.println(Father.A);
    }

}
